<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head lang="en">
    <th:block th:include="/common/lib :: lib"></th:block>
    <script>

            function typeFun(pageNum,typeVal) {
                var param = "pageNum="+pageNum;
                if(typeVal != ""){
                    typeVal = typeVal.replace(/\+/g,"%2B");
                    param += "!!type="+typeVal;
                }
                window.location.href = "/portal/article/list?param=" + param;
            }


    </script>
</head>
<body>

<div th:replace="/common/header :: header"></div>

<div class="container content-main">
    <input type="hidden" id="contentType" th:value="${type}"/>
    <div class="row">
        <div class="col-lg-9 col-md-8 col-sm-12 border-right-1">
            <h4 class="s-title hidden-xs ">
                <i class="glyphicon glyphicon-th-list"></i>
                笔记
            </h4>
            <div class="tabbable"> <!-- Only required for left/right tabs -->
                <ul class="nav nav-tabs">
                    <li th:class="${type}==null ? 'active' : ''"><a href="/portal/article/list">最新</a></li>
                    <li th:each="cType : ${contentTypeList}"
                        th:class="${type}==${cType.contentType} ? 'active' : ''">
                        <a th:href="@{/portal/article/list(pageNum=1,type=${cType.contentType})}"
                           th:text="${cType.contentType}">

                        </a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" >
                        <div class="table-cell" th:each="article : ${articleList}">
                            <div class="aw-user-name hidden-xs" href="">
                                <img th:src="${article.photoUrl}" alt=""/>
                            </div>
                            <div class="content-info">
                                <h5 class="title"><a th:href="@{'/portal/article/detail/'+${article.id}}" th:text="${article.title}"></a></h5>
                                <p class="subtitle"><a th:text="${article.realName} +' • '+${article.contentType} +' • '+ ${#dates.format(article.updateDate, 'yyyy-MM-dd HH:mm')}"></a></p>
                            </div>
                        </div>
                        <nav aria-label="...">
                            <ul class="pager">
                                <li><a th:href="@{/portal/article/list(pageNum=(${pageNum}-1),type=${type})}" th:if="${hasPrev}">上一页</a></li>
                                <li><a th:href="@{/portal/article/list(pageNum=(${pageNum}+1),type=${type})}" th:if="${hasNext}">下一页</a></li>
                            </ul>
                        </nav>

                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-4 hidden-xs hidden-sm">
            <div class="widget">
                <h5 class="title">发现</h5>
                <ul>
                    <li><a>这个是什么内容呢，我需要好好</a></li>
                    <li><a>这个是什么内容呢，我需要好好</a></li>
                    <li><a>这个是什么内容呢，我需要好好</a></li>
                    <li><a>这个是什么内容呢，我需要好好</a></li>
                    <li><a>这个是什么内容呢，我需要好好</a></li>
                </ul>
            </div>
        </div>

    </div>

</div>
</body>
</html>